<template>
    <div>
        <my-input v-model='todo' @submit='fn'></my-input>
        <my-list :data='ary' @del='del'></my-list>
        {{300|money}}
    </div>
</template>
<script>
// @ is an alias to /src
import list from './list'
export default {
    name: 'XXX',
    data() {
        return {
          todo:'',
          ary:[]
        }
    },
    methods: {
      fn(){
        console.log(this.todo)
        this.ary.unshift(this.todo)
        this.todo = '';
      },
      del(n){
        this.ary.splice(n,1)
      }
    },
    components: {
        'my-list':list
    }
}
</script>
<style lang="less">

</style>